
import instance from "@/request"
import qs from "qs"
//精品推荐
export const jingpingAPI = () => instance.get("products/recommend")

//热门推荐
export const hotAPI = () => instance.get("/products/hot")

//获取短信验证码的请求
export const SendSMS = (params) => instance.post("/sendSMS",qs.stringify(params) )

//手机号登录请求
export const PhoneLoginAPI = (params) => instance.post("/phoneRegin",qs.stringify(params) )
//获取用户信息
export const GetUserInfoAPI = () => instance.get('/shop/userProfiles');

//微信扫码 api大写
export const WeixinLoginAPI = (params) =>instance.post("/wechatUsers/PCLogin",qs.stringify(params));

//绑定手机号
export const bindPhoneAPI = (params) =>instance.post("/wechatUsers/binding",qs.stringify(params));

//商品详情
export const GoodDetailsAPI = (id) => instance.get(`/products/${id}`);

//加入购物车请求
export const AddtoCartAPI = (params) =>instance.post("/shop/carts/add",qs.stringify(params));

//获取全部商品列表
export const GitListAPI = (params) => instance.get('/products',{params});

//手机号微信解绑
export const unBindingAPI = () => instance.put('/wechatUsers/unbindingWeChat');

//购物车数据
export const CartAPI = () => instance.get('/shop/carts');

//删除购物车宝贝
export const DeleteCartAPI = (id) => instance.delete(`/shop/carts?productIds=${id}`);